package com.hyf.meterialdesign.activity;

import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.Toast;

import com.hyf.meterialdesign.BaseActivity;
import com.hyf.meterialdesign.R;

public class SystemBarTintActivity extends BaseActivity {

    private FloatingActionButton fab;
    private CoordinatorLayout rootView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_system_bar_tint);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        initView();
        initData();
    }

    @Override
    protected void initData() {
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Snackbar.make(rootView,"德玛西亚",Snackbar.LENGTH_SHORT).setAction("点击", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Toast.makeText(SystemBarTintActivity.this, "点了", Toast.LENGTH_SHORT).show();
                    }
                }).show();
            }
        });
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initView() {
        fab = (FloatingActionButton) findViewById(R.id.fab);
        rootView = (CoordinatorLayout) findViewById(R.id.activity_system_bar_tint);
    }
}
